Skip to content

feat: add xidl to ECOSYSTEM.md#3687

Open
cathaysia wants to merge 1 commit intotokio-rs:mainfrom
cathaysia:cathaysia-patch-1
Open

feat: add xidl to ECOSYSTEM.md#3687
cathaysia wants to merge 1 commit intotokio-rs:mainfrom
cathaysia:cathaysia-patch-1

Conversation

@cathaysia
Copy link

Motivation

Unify the Axum error model, handle Axum boilerplate code, and generate OpenAPI.

Solution

  1. install xidlc:

cargo binstall xidlc

  1. write a idl:
interface SmartCityHttpApi {
    @get(path = "/v1/stops/{stop_id}{?line,lang}")
    string get_stop_eta(
        string stop_id,
        string line,
        string locale,
        out uint32 eta_seconds,
        out string destination
    );

    @get(path = "/v1/stops/{stop_id}/nearby")
    sequence<string> list_nearby_stops(
        @path("stop_id") string stop_id
    );
}
  1. generate code

xidlc -l axum api.idl --server --client
xidlc -l openapi api.idl

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant